package com.company;

import java.util.Scanner;

public class Teacher {
    int number;
    String name;
    String gender;
    String course;
    int course1;
    int age;
    public Teacher(int number,String name){
        this.number=number;
        this.name=name;
    }
    public Teacher(int number,String name,String gender,String course,int course1){
        this.number=number;
        this.name=name;
        this.gender=gender;
        this.course=course;
        this.course1=course1;
    }
    public Teacher(int number,String name,String gender,String course,int course1,int age){
        this.number=number;
        this.name=name;
        this.gender=gender;
        this.course=course;
        this.course1=course1;
        this.age=age;
    }
    public void tchoice(Teacher a1,Teacher b1,Course a2,Course b2){
        System.out.println("按1为李老师开课，按2为王老师开课,按其他数字返回：");
        Scanner input1=new Scanner(System.in);
        int c1=input1.nextInt();
        if(c1==1){
            System.out.println("按1为选数学，按2为选英语：");
            Scanner input2=new Scanner(System.in);
            int c2=input2.nextInt();
            if(c2==1 && a1.course1==0 && a2.teacher1==0){
                a1.course=a2.name;
                a2.teacher=a1.name;
                a1.course1=1;
                a2.teacher1=1;
                System.out.println("开课成功");
            }
            if(c2==2 && a1.course1==0 && b2.teacher1==0){
                a1.course=b2.name;
                b2.teacher=a1.name;
                a1.course1=1;
                b2.teacher1=1;
                System.out.println("开课成功");
            }
        }
        if(c1==2){
            System.out.println("按1为选数学，按2为选英语：");
            Scanner input2=new Scanner(System.in);
            int c2=input2.nextInt();
            if(c2==1 && b1.course1==0 && a2.teacher1==0){
                b1.course=a2.name;
                a2.teacher=b1.name;
                b1.course1=1;
                a2.teacher1=1;
                System.out.println("开课成功");
            }
            if(c2==2 &&b1.course1==0&& b2.teacher1==0){
                b1.course=b2.name;
                b2.teacher=b1.name;
                b1.course1=1;
                b2.teacher1=1;
                System.out.println("开课成功");
            }
        }
    }
}

